Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX fk_account is lost when we update payment information #20759

Closed
wants to merge 1 commit into from

Conversation

aspangaro
Copy link
Member

Refer to this post in french forum : https://www.dolibarr.fr/forum/t/bug-ecriture-casse-apres-modification-du-mode-de-paiement-si-lecriture-est-rapproche/39977/2

A description of the conditions in which the bug occurs
(If needed screen copy/logs...)
Anomaly 1 : Writing on internal transfer

I create an internal transfer whatever the account and the amount.
I enter a statement name and reconcile the entry by checking the box.
To break the entry, I forget to uncheck the box Entry reconciled with the bank statement and I change the payment method.
The entry is broken and impossible to modify.
If I check the box for reconciliation again, the entry is no longer linked.
*It is still possible to delete one of the two entries, the other is no longer displayed in the list of entries but when you export the entries in csv, it appears in the export.

Anomaly 2: Entry on miscellaneous payment
I create a miscellaneous payment regardless of the amount, the account and the debit/credit direction.

I enter a statement name and reconcile the entry by checking the box.
To break the entry, I forget to uncheck the box Entry reconciled with the bank statement and I change the payment method.
The entry is broken and it is impossible to modify or delete it because it is transformed into a cash entry and does not appear in the cashier's entry.
*The entry is present in the csv export of the various payment entries.

When the entry is cleared, it is possible to change the payment mode in the drop-down list. I think that this field should be blocked if the entry is reconciled.

@@ -130,9 +130,9 @@

$actarget = new Account($db);
if (GETPOST('accountid', 'int') > 0 && !$acline->rappro && !$acline->getVentilExportCompta()) { // We ask to change bank account
$actarget->fetch(GETPOST('accountid', 'int'));
$account_id = $actarget->fetch(GETPOST('accountid', 'int'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks strange: A fetch return an error code (so 0 or -1) but you store it into a field that is an id of a bank account ?

@eldy eldy added the PR to fix or conflict to solve PR needs to be fixed to be integrated (except for conflicts, a comment describes the fix to do) label May 1, 2022
@eldy
Copy link
Member

eldy commented May 20, 2022

I pushed recently a fix around this.
Differently. I also added a feature to be able to restore the link when data has been corrupted. Can you check that current code in develop is ok for your trouble ?

@eldy eldy added Discussion Some questions or discussions are opened and wait answers of author or other people to be processed and removed PR to fix or conflict to solve PR needs to be fixed to be integrated (except for conflicts, a comment describes the fix to do) labels May 20, 2022
@aspangaro aspangaro closed this May 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Some questions or discussions are opened and wait answers of author or other people to be processed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants